/*
  将下面异步代码使用 Promise 的方法改进
  尽量用看上去像同步代码的方式
  setTimeout(function () {
    var a = 'hello'
    setTimeout(function () {
      var b = 'lagou'
      setTimeout(function () {
        var c = 'I ♥ U'
        console.log(a + b +c)
      }, 10)
    }, 10)
  }, 10)
*/

let p = new Promise((resolve, reject) => {
  setTimeout(resolve, 10, 'hello');
});
p.then(res => {
      return new Promise((resolve, reject) => {
          let b = 'lagou'
          setTimeout(resolve, 10, res+b);
      });
  }).then(
      res => {
        let c = 'I ♥ U'
        setTimeout(() => console.log(res+c), 10);
      }
  );